package com.gba.mark.exam.controller;

import com.gba.mark.exam.entity.ExamAnswer;
import com.gba.mark.exam.entity.ExamQuestions;
import com.gba.mark.exam.entity.ExamResult;
import com.gba.mark.exam.service.ExamResultService;
import com.gba.mark.util.ResponseUtil;
//import com.qigetech.utils.resultbundle.ResultBundleBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
    @RequestMapping("/exam/result")
    public class ExamResultController {

        @Autowired
        private ExamResultService examResultService;

//        @Autowired
//        private ResultBundleBuilder resultBundleBuilder;


    /**
     * 新建并保存一份考试结果
     */

    @PostMapping("/saveResult")
    public ResponseUtil<Integer> update(@RequestBody List<ExamQuestions> answer,
                                        @RequestBody List<ExamAnswer> user_answer ){
        return new ResponseUtil<>(HttpStatus.OK,examResultService.saveResult(answer, user_answer));

    }
}
